// main_init function

main_init = function(mc){
 col_width = 0;
 box = function(mc,tl_x, tl_y, br_x, br_y, cf ){
  mc.lineStyle();
  mc.beginFill(cf);
  mc.moveTo (tl_x,tl_y);
  mc.lineTo (br_x,tl_y);
  mc.lineTo (br_x,br_y);
  mc.lineTo (tl_x,br_y);
  mc.endFill();
 }
 random_letter = function(i){
  o = new Object();
  o._x = Math.floor(mc._width * (Math.random()-.5) / col_width) * col_width; 
  o._y = Math.floor(mc._height * (Math.random()-.5)); 
  o._alpha = 40 + Math.floor(Math.random() * 50); 
  o._xscale = o._yscale = 50 + Math.floor(Math.random() * 40); 
  $smc[Math.floor(Math.random()*$sub_cnt)].duplicateMovieClip("rmc"+i,-i,o);
  clr = new Color($mmc["rmc"+i]);
  clr.setRGB(letter_color); 
 } 
 subs_done = true;
 for(i=0;i<$sub_cnt;i++) col_width = Math.max(col_width,$smc[i]._width);
 col_width = col_width - $padding + colspace;
 createEmptyMovieClip("mask",6);
 mc.setMask(mask);
 hh = Math.ceil((mc._height-$padding) / 2) + 10;
 hw = Math.ceil((mc._width-$padding) / 2) + 10;
 box(mask,-hw,-hh,hw,hh,0);
 for(i=0;i<letters;i++){
  random_letter(i);
  if (start_blank) $mmc["rmc"+I]._xscale = 0; 
 }
}

// main_effect function

main_effect = function(mc,frame){
 for(i=0;i<letters;i++){
  rmc = $mmc["rmc"+i];
  rmc._alpha-= alpha_decrease_speed;
  rmc._y+= fall_speed;
  if (((rmc._y - (rmc._height-$padding) / 2) > hh)||(rmc._alpha<1)) random_letter(i);
 }  
}

// sub_init function

sub_init = function(mc){
 if(!text_visible) mc._alpha = 0;
}

// sub_effect function

sub_effect = function(mc,frame){
}

